package com.newgrand.controller;

import com.newgrand.domain.model.I8ReturnModel;
import com.newgrand.domain.model.ProjectSubcontracts;
import com.newgrand.service.ProjectSubcontractsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @创建人：ZhaoFengjie
 * @修改人：ZhaoFengjie
 * @创建时间：18:17 2022/10/17
 * @修改时间:：18:17 2022/10/17
 */
@Api(tags = "分包合同")
@RequestMapping("/ProjectSubcontracts")
@RestController
public class ProjectSubcontractsController {

    @Resource
    private ProjectSubcontractsService projectSubcontractsService;

    @ApiOperation(value = "分包合同数据获取接口", notes = "分包合同数据获取接口", produces = "application/json")
    @RequestMapping(value = "/GetDataByOrgId", method = RequestMethod.GET)
    I8ReturnModel<List<ProjectSubcontracts.ProjectSubcontractsData.ProjectSubcontractsItem>> getDataByOrgId(String orgId) {
        return projectSubcontractsService.getDataByOrgId(orgId);
    }

    @ApiOperation(value = "分包合同数据保存接口", notes = "分包合同数据保存接口", produces = "application/json")
    @RequestMapping(value = "/SaveDataByOrgId", method = RequestMethod.GET)
    I8ReturnModel<String> saevDataByOrgId(String orgId) {
        return projectSubcontractsService.saveDataByOrgId(orgId);
    }
}
